import Vue from 'vue'
import Router from 'vue-router'
import Home from "../components/Home";
import Course from "../components/Course";
import Cart from "../components/Cart";
import Detail from "../components/Detail";
import Login from "../components/Login";
import Register from "../components/Register";
import Order from "../components/Order";
import Success from "../components/Success";
import UserOrder from "../components/user/Order";
import Player from "../components/Player";
//这里导入可以让用户访问组件
Vue.use(Router)

export default new Router({
  //设置路由模式为'history' 去掉默认的#
  mode:'history',
  routes:[
    //路由列表

     {
      name: 'router',
      path: '/Home',
      component: Home,

    },
       {
      name: 'router',
      path: '',
      component: Home,

    },
    {
      name: 'Course',
      path: '/course',
      component: Course,
    },
    {
      name: 'Cart',
      path: '/cart',
      component: Cart,
    },
    {
      name: 'Detail',
      path: '/course/:course',//:course为参数占位符
      component: Detail,
    },
    {
      name:'Login',
      path:'/user/login',
      component:Login,
    },
       {
      name:'Register',
      path:'/user/Register',
      component:Register,
    },
           {
      name:'Order',
      path:'/order',
      component:Order,
    },
               {
      name:'Success',
      path:'/pay/result',
      component:Success,
    },
    {
      path:"/user/order",
      name:"UserOrder",
      component: UserOrder
    },
          {
       name:"Player",
       path:"/player",
       component: Player,
     },
  ]
})
